-- Leviathan (c) v.v.balashoff
local Color = require('libs/colorlibrary/colorlibrary')
local Class = require('leviathan/Class')

local RectangleComponent = Class:derive('RectangleComponent')

function RectangleComponent:new(mode, x, y, w, h, rx, ry, color)
    self.id = 'RectangleComponent'
    self.typeId = 'Renderable'
    self.drawable = true
    self.enabled = true

    self.mode = mode or 'fill'
    self.x = x or 0
    self.y = y or 0
    self.w = w or love.graphics.getWidth()
    self.h = h or love.graphics.getHeight()
    self.rx = rx
    self.ry = ry
    self.color = color or Color.black
    -- rounding values
    self.x = math.floor(self.x)
    self.y = math.floor(self.y)
    self.w = math.floor(self.w)
    self.h = math.floor(self.h)
end

return RectangleComponent
